#include <mockcpp/mockcpp.hpp>
#include <testngpp/testngpp.hpp>
#include <Length.h>
#include <Unit.h>
#include <LengthOutput.h>
#include <LengthUnit.h>
#include <VolumeUnit.h> 
#include <string>
#include <sstream>
#include <iostream>
using namespace std;

FIXTURE(Length)
{
    TEST(1 MILE ==1760 YARD should be true)
    {
        Length<LengthUnit> length1(1, MILE), length2(1760, YARD);
        ASSERT_TRUE(length1==length2);
    }

    TEST(3 YARD ==3 YARD should be true)
    {
        Length<LengthUnit> length1(3, YARD), length2(3, YARD);
        ASSERT_TRUE(length1==length2);
    }

    TEST(2 MILE !=1760 YARD should be true)
    {
        Length<LengthUnit> length1(2, MILE), length2(1760, YARD);
        ASSERT_TRUE(length1!=length2);
    }

    TEST(4 YARD !=3 YARD should be true)
    {
        Length<LengthUnit> length1(4, YARD), length2(3, YARD);
        ASSERT_TRUE(length1!=length2);
    }

    TEST(1 YARD ==3 FEET should be true)
    {
        Length<LengthUnit> length1(1, YARD), length2(3, FEET);
        ASSERT_TRUE(length1==length2);
    }
    TEST(1 MILE ==3*1760 FEET should be true)
    {
        Length<LengthUnit> length1(1, MILE), length2(5280, FEET);
        ASSERT_TRUE(length1==length2);
    }
    TEST(1 YARD+ 2 FEET = 5 FEET)
    {
        Length<LengthUnit> totalLength(5,FEET), length1(1, YARD), length2(2, FEET);
        ASSERT_TRUE(totalLength==length1+length2);
    }
};

#if 1
FIXTURE(LengthOutput)
{
  TEST(5 FEET shoult output be "1YARD2FEET" )
  {
    Length<LengthUnit> length(5,FEET);
    ostringstream out; 
    length.outPut(out, OutPutInSeq<LengthUnit>::getInstance());
    //ASSERT_EQ("1YARD2FEET", out.str());
  } 

  TEST(5 FEET shoult output be "60INCH" )
  {
    Length<LengthUnit> length(5,FEET);
    ostringstream out;
    length.outPut(out, OutPutInBase<LengthUnit>::getInstance());
    //ASSERT_EQ("60INCH", out.str());
  } 

};
#endif









